#include <iostream>
using namespace std;

void swap(float &a, float &b)
{
    cout << "开始交换" << endl;
    float temp = a;
    a = b;
    b = temp;
}

int main()
{
    int a = 10;
    int b = 20;
    float f = 12.345;
    float g = 6.789;
    cout << "交换前:" << endl;
    cout << "f = " << f << endl;
    cout << "g = " << g << endl;
    swap(f, g);
    cout << "交换后:" << endl;
    cout << "f = " << f << endl;
    cout << "g = " << g << endl;


    return 0;
}
